package com.zy.web.demo.duoxiancheng.demo29;

/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/8/31 16:15
 */
public class Test29 {

    public static final int INT = 10;

    public static void main(String[] args) {
        final Service29 service29 = new Service29(false);
        Runnable runnable = () -> {
            System.out.println("---线程："+Thread.currentThread().getName()+"运行了");
            service29.service();
        };
        Thread[] threads = new Thread[10];
        for (int i = 0; i < INT; i++) {
            threads[i] = new Thread(runnable);
        }
        for (int i = 0; i < INT; i++) {
            threads[i].start();
        }
    }

}
